import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  
 {
   path:'/',
   component:()=>import('@/views/Home.vue'),
   children:[
     {
       path:"/",
       redirect:"/home"
     },
     {
       path:"home",
       component:()=>import('@/pages/pageHome.vue'),
     },
     {
       path:"category",
       component:()=>import('@/pages/pageCate.vue'),
     },
     {
       path:"cart",
       component:()=>import('@/pages/pageCart.vue'),
     },
     {
       path:"my",
       component:()=>import('@/pages/pageMy.vue'),
       children:[
         
       ]
     },
   ]
 },
 {
   path:"/detail",
   component:()=>import('@/views/detail.vue'),
 },
 {
   path:"/login",
   component:()=>import('@/views/login.vue'),
 },
 {
   path:"/search",
   component:()=>import('@/views/search.vue'),
 },
 {
  path:"/my/myOption",
  name:"myOption",
  component:()=>import('@/components/pageMy/myOption.vue')
 }
]

const router = new VueRouter({
  routes,
  linkActiveClass:"active"
})

export default router
